Telegram Group & Telegram Channel
Что выведет следующий код на Python?


a = 256
b = 256
c = 257
d = 257

print(a is b) # #1
print(c is d) # #2

print(True + True + True == 3) # #3
print(True is 1) # #4
print(False == 0) # #5
print(False is 0) # #6


🔢 Варианты ответа:

A)

True
True
True
True
True


B)

False
True
False
True
False


C)

False
True
False
True
False


D)

True
False
False
False
False


Правильный ответ: B

💡 Почему?
-
a is bTrue, потому что int от -5 до 256 кэшируются.
-
c is dFalse, число 257 не кэшируется.
-
True + True + True == 3True, более того, True == 1.
-
True is 1False — это разные типы (bool и int).
-
False == 0True, False is 0False.



tg-me.com/pro_python_code/1788
Create:
Last Update:

Что выведет следующий код на Python?


a = 256
b = 256
c = 257
d = 257

print(a is b) # #1
print(c is d) # #2

print(True + True + True == 3) # #3
print(True is 1) # #4
print(False == 0) # #5
print(False is 0) # #6


🔢 Варианты ответа:

A)

True
True
True
True
True


B)

False
True
False
True
False


C)

False
True
False
True
False


D)

True
False
False
False
False


Правильный ответ: B

💡 Почему?
-
a is bTrue, потому что int от -5 до 256 кэшируются.
-
c is dFalse, число 257 не кэшируется.
-
True + True + True == 3True, более того, True == 1.
-
True is 1False — это разные типы (bool и int).
-
False == 0True, False is 0False.

BY Python RU


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/pro_python_code/1788

View MORE
Open in Telegram


Python RU Telegram | DID YOU KNOW?

Date: |

However, analysts are positive on the stock now. “We have seen a huge downside movement in the stock due to the central electricity regulatory commission’s (CERC) order that seems to be negative from 2014-15 onwards but we cannot take a linear negative view on the stock and further downside movement on the stock is unlikely. Currently stock is underpriced. Investors can bet on it for a longer horizon," said Vivek Gupta, director research at CapitalVia Global Research.

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

Python RU from ca


Telegram Python RU
FROM USA